//
//  ThirdController.swift
//  fho
//
//  Created by 郭颢源 on 2021/3/19.
//

import UIKit
import SnapKit

class ThirdController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        self.edgesForExtendedLayout = .init()
        
        let stackView = UIStackView()
        view.addSubview(stackView)
        stackView.axis = .vertical
        stackView.spacing = 20;
        stackView.alignment = .fill
        stackView.distribution = .fillEqually
        stackView.snp.makeConstraints { (make) in
            make.edges.equalToSuperview().inset(UIEdgeInsets(top: 20,left: 20,bottom: 20,right: 20))

            
        }
        
        let btn1 = UIButton(type: .custom)
        btn1.setTitle("发快递", for: .normal)
        btn1.backgroundColor = .red
        btn1.layer.cornerRadius = 5.0
        btn1.layer.masksToBounds = true
        
        let btn2 = UIButton(type: .custom)
        btn2.setTitle("发零担", for: .normal)
        btn2.backgroundColor = .red
        btn2.layer.cornerRadius = 5.0
        btn2.layer.masksToBounds = true
        
        let btn3 = UIButton(type: .custom)
        btn3.setTitle("发整车", for: .normal)
        btn3.backgroundColor = .red
        btn3.layer.cornerRadius = 5.0
        btn3.layer.masksToBounds = true
        
        stackView.addArrangedSubview(btn1)
        stackView.addArrangedSubview(btn2)
        stackView.addArrangedSubview(btn3)

        btn1.addTarget(self, action: #selector(click1(_:)), for: .touchUpInside)
        btn2.addTarget(self, action: #selector(click2(sender:)), for: .touchUpInside)
        btn3.addTarget(self, action: #selector(click3(sender:)), for: .touchUpInside)
        

        // Do any additional setup after loading the view.
    }
    @objc func click1(_ sender:UIButton){
        
        sender.sg_timeInterval(time: 0.5)
        
        self.navigationController?.pushViewController(JSFKDViewController(), animated: true)
    }
    @objc func click2(sender:UIButton){
        sender.sg_timeInterval(time: 0.5)
        
        self.navigationController?.pushViewController(JSNewWaybillController(), animated: true)
    }

    @objc func click3(sender:UIButton){
        sender.sg_timeInterval(time: 0.5)
        
        self.navigationController?.pushViewController(JSSendvehicleController(), animated: true)
    }
    /*
    // MARK: - Navigation

    // In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
        // Get the new view controller using segue.destination.
        // Pass the selected object to the new view controller.
    }
    */

}
